#include <iostream>
#include <stdio.h>
#include <limits.h>
#include <vector>
#include <algorithm>
#include <math.h>
#include <stack>
using namespace std;

int assign_banana(vector<int> & monkey, vector<int> & banana) {
    //time：记录每只猴子移动的时间
    sort(monkey.begin(), monkey.end());
    sort(banana.begin(), banana.end());
    int max = 0;
    for (unsigned int i = 0; i < monkey.size(); i++) {
        if (fabs(monkey[i] - banana[i]) > max) {
            max = fabs(monkey[i] - banana[i]);
        }
    }
    return max;
}
int main() {
    vector<int> monkey;
    vector<int> banana;
    int a;
    while(cin >> a){
        monkey.push_back(a);
        if(cin.get() == '\n')
            break;
    }
    while(cin >> a){
        banana.push_back(a);
        if(cin.get() == '\n')
            break;
    }
    cout << assign_banana(monkey, banana) << endl;
    return 0;
}